<template>
  <view class="mySearchContainer" :style="{'background-color':bgcolor}">
    <view class="mySearchBox" :style="{'border-radius':radius+'px'}"  @click="searchBoxHandle">
      <!-- 使用uni-ui提供的图标组件 -->
      <uni-icons type="search" size="17" class='icon'></uni-icons>
      <text class="text">搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    props:{
      bgcolor:{
        type:String,
        default:"#c00000"
      },
      radius:{
        type:Number,
        default:18
      }
    },
    data() {
      return {
        
      };
    },
    methods:{
      searchBoxHandle(){
        // 触发自定义时间
        this.$emit('click')
      }
    }
  }
</script>

<style lang="scss" scoped>
.mySearchContainer{
  height: 60px;
  background-color: #e00000;
  display: flex;
  justify-content: center;
  align-items: center;
  .mySearchBox{
    width: 90%;
    height: 35px;
    background-color: #fff;
    border-radius: 25px;
    text-align: center;
    line-height: 35px;
    .icon{
      margin-right: 10px;
    }
  }
}
</style>